package com.yeyks.commonReference.service.consumer;

import com.yeyks.account.dal.domain.AccountInfo;
import com.yeyks.common.param.CashOutDownloadParam;
import com.yeyks.common.result.CashOutDownloadResult;
import com.yeyks.consumer.dal.domain.CashOutOrder;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yeyks.common.ajax.AjaxResponseBody;
import com.yeyks.common.param.CashOutQueryParam;
import com.yeyks.consumer.param.CashOutOrderExtractParam;
import org.springframework.http.ResponseEntity;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;


/**
 * <p>
 * 用户提现订单表 服务类
 * </p>
 *
 * @author yun
 * @since 2019-06-25
 */
public interface CashOutOrderService extends IService<CashOutOrder> {

    /**
     * 分页查询提现信息
     * @param cashOutQueryParam 查询参数
     * @param pageNum 当前页
     * @param pageSize 单页个数大小
     * @return
     */
    ResponseEntity<AjaxResponseBody> queryList(CashOutQueryParam cashOutQueryParam, Integer pageNum, Integer pageSize);

    /**
     * 确认打款
     * @param token 有效token
     * @param id 主键ID
     * @return
     */
    ResponseEntity<AjaxResponseBody> confirmMoney(String token, Long id, String ip);

    /**
     * 取消打款
     * @param token
     * @param id
     * @return
     */
    ResponseEntity<AjaxResponseBody> refundMoney(String token, Long id, String remark);
    /**
     * 获取指定用户最新的提现记录
     *
     * @param userId
     * @return
     */
    CashOutOrder getNewestCashOutOrder(Integer userId);

    /**
     * 我的佣金页面
     *
     * @param userInfo
     * @return
     */
//    AccountOverviewDTO info(UserInfo userInfo);

    /**
     * 用户提现(银行卡)
     *
     * @param userInfo
     * @param amount
     * @return
     */
//    Boolean extract(UserInfo userInfo, Integer amount);

    //提现
    @Transactional(rollbackFor = Exception.class)
    Boolean extract(CashOutOrderExtractParam param);

    /**
     * 提现常见问题
     *
     * @return
     */
    Object problem();

    /**
     * 导出订单
     *
     * @param loginUser
     * @param param
     * @return
     */
    List<CashOutDownloadResult> selectDownloadOrder(AccountInfo loginUser, CashOutDownloadParam param);
}
